<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增通道')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-channel-add">
<!--        <div class="form-group">-->
<!--            <label class="col-sm-3 control-label is-required">渠道编号：</label>-->
<!--            <div class="col-sm-8">-->
<!--                <input name="channelCode" class="form-control" type="text" required>-->
<!--            </div>-->
<!--        </div>-->
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">接口名称：</label>
            <div class="col-sm-8">
                <input name="channelName" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">通道类型：</label>
            <div class="col-sm-8">
                <select name="channelTypes" class="form-control m-b" th:with="type=${@dict.getType('sys_channel_type')}">
                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                </select>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">网关地址：</label>
            <div class="col-sm-8">
                <input name="channelGateway" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">页面通知地址：</label>
            <div class="col-sm-8">
                <input name="channelCallbackurl" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">回调地址：</label>
            <div class="col-sm-8">
                <input name="channelNotifyurl" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">appid：</label>
            <div class="col-sm-8">
                <input name="channelAppid" class="form-control" type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">商户秘钥：</label>
            <div class="col-sm-8">
                <textarea name="channelKey" class="form-control" type="text" required></textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">通道费率：</label>
            <div class="col-sm-8">
                <input name="channelRate" class="form-control" type="text" required>
                <span class="help-block m-b-none">例如：千分之三填 0.003</span>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">接口状态：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_all_status')}">
                    <input type="radio" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
                    <label th:for="${dict.dictLabel}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户端显示：</label>
            <div class="col-sm-8">
                <div class="radio-box" th:each="dict : ${@dict.getType('sys_user_show')}">
                    <input type="radio" name="channelUsershow" th:value="${dict.dictValue}" th:checked="${dict.default}">
                    <label th:for="${dict.dictLabel}" th:text="${dict.dictLabel}"></label>
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "system/channel"
    $("#form-channel-add").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-channel-add').serialize());
        }
    }
</script>
</body>
</html>